package Jclass;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class SchoolClassTest {
    public static void main(String[] args) {
        JClass j76 = new JClass();
        j76.name = "课工场76班";
        j76.startTime = "2021-9-15";
        j76.dirTeacher = "老李";
        j76.techTeacher = "老刘";
        ///j76.stus[0]="孙囡囡";
        Scanner in = new Scanner(System.in);
        int choice = 0;
        while (true) {
            System.out.println("1:添加新生，2：显示全部,3:查找学生，4:通过位置查找学生，5,修改学生信息，9：退出");
            choice = in.nextInt();
            if (choice == 1) {
                System.out.print("请输入新生姓名：");
                String sname = in.next();
                j76.add(sname);
            } else if (choice == 2) {
                j76.printInfor();
            } else if (choice == 3) {
                System.out.println("你要找谁？");
                String sname=in.next();
                System.out.print("请输入查找范围");
                System.out.println("从第几个开始：");
                int start = in.nextInt();
                System.out.println("到底几个结束：");
                int end=in.nextInt();
                boolean b = j76.searchRange(sname,start,end);
                System.out.println(b ? "在这个班" : "不在!");
            } else if (choice == 9) {
                break;
            }else if(choice==4){
                System.out.println("请输入要查找学生的位置：");
                int index=in.nextInt();
                j76.find(index);
            }else if (choice==5){
                System.out.println("请输入要修改学生的姓名：");
                String stuOld=in.next();
                System.out.println("请输入要修改的名字");
                String stuNew=in.next();
                j76.modify(stuOld,stuNew);
            }
        }
        System.out.println("结束了。。。");
    }
}
